#include<iostream>
#include<vector>
using namespace std;

//LeeCode 3151, 3152
bool isArraySpecial(vector<int>& nums) {
    int first = 0;
    int second = 1;
    if(nums.size()==0)
        return true;
    if(nums.size()==1)
        return true;
    while(second<nums.size())
    {
        if((nums[first]+nums[second])%2==0)
            return false;
        first++;
        second++;
    }
    return true;
}
vector<bool> isArraySpecial2(vector<int>& nums, vector<vector<int>>& queries) {
        vector<bool> result;
        for(int i=0;i<queries.size();i++)
        {
            vector<int> subVec(nums.begin()+queries[i][0],nums.begin()+queries[i][1]+1);
            result.push_back(isArraySpecial(subVec));
        }
        return result;
}
int main()
{
    vector<int> nums = {4,3,1,6};
    // if(isArraySpecial(nums))
    //     cout<<"true"<<endl;
    // else
    //     cout<<"false"<<endl;
    vector<vector<int>> queries = {{0,1},{2,3},{1,2}};
    vector<bool> result = isArraySpecial2(nums,queries);
    for(int i=0;i<result.size();i++)
    {
        if(result[i])
            cout<<"true"<<endl;
        else
            cout<<"false"<<endl;
    }
    return 0;
}